odoo.define('web.fhbasic_fields', function (require) {
    "use strict";
	
	
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var crash_manager = require('web.crash_manager');
var datepicker = require('web.datepicker');
var dom = require('web.dom');
var Domain = require('web.Domain');
var DomainSelector = require('web.DomainSelector');
var DomainSelectorDialog = require('web.DomainSelectorDialog');
var framework = require('web.framework');
var session = require('web.session');
var utils = require('web.utils');
var view_dialogs = require('web.view_dialogs');
var field_utils = require('web.field_utils');
var registry = require('web.field_registry');

var qweb = core.qweb;
var _t = core._t;
var lcontext='';
var fhtable = AbstractField.extend({
    template: 'WebformfhtreeMain',	
    events: {
        change: '_onchange'
    },
    init: function(parent, data){
         	
        this._super.apply(this, arguments);
        
		
    },


    start: function(){
           return this.load();
    },


    load: function () {
			var self = this;
			
            var loading_done = new $.Deferred();
            session.rpc("/web_widget_iframe/data2", {}).then(function (data) {
            console.log('--------核心代码1-------',self.mode);
			/*
			if(self.mode== 'edit')
			{
            var table1 = document.getElementById("fname1");
            table1.style.display="block";
            var table2 = document.getElementById("fname2");
            table2.style.display="none";			
			
			
            table1.value=self.value;
			}		
			if(self.mode=="readonly")
			{
				
            var table1 = document.getElementById("fname1");
            table1.style.display="none";				
            var table2 = document.getElementById("fname2");
            table2.style.display="block";			 
            table2.innerText=self.value;
			}				
			*/
          });
            return true;
        },
 

    _onchange: function (event) {
     console.log('--------data1111:--------');
	 var self = this;
     var loading_done = new $.Deferred();		
     session.rpc("/web_widget_iframe/data2", {}).then(function (data) {
         /*
       var table1 = document.getElementById("fname1");
	   console.log('--------核心代码2--------');	   
	   self._setValue(table1.value);
	   */
     });
    },
	


});

    registry.add('fhtable', fhtable);
    return {
        fhtable: fhtable,
    };

});
